﻿using System;
using System.Collections.Generic;

namespace MessagingWPF.Infrastructure
{
	/// <summary>
	/// A thread-safe subscription collection.
	/// </summary>
	public interface ISubscriptionRegistry
	{
		/// <summary>
		/// Gets the subscriptions.
		/// </summary>
		/// <param name="messageType">Type of the message.</param>
		/// <returns>The list of subscriptions.</returns>
		List<Subscription> GetSubscriptions(Type messageType);

		/// <summary>
		/// Adds the subscription.
		/// </summary>
		/// <param name="subscription">The subscription.</param>
		void AddSubscription(Subscription subscription);

		/// <summary>
		/// Adds the subscriptions.
		/// </summary>
		/// <param name="subscriptions">The subscriptions.</param>
		void AddSubscriptions(IEnumerable<Subscription> subscriptions);

		/// <summary>
		/// Removes the subscriptions.
		/// </summary>
		/// <param name="subscriptions">The subscriptions.</param>
		void RemoveSubscriptions(IEnumerable<Subscription> subscriptions);

		/// <summary>
		/// Removes the subscription.
		/// </summary>
		/// <param name="subscription">The subscription.</param>
		void RemoveSubscription(Subscription subscription);
	}
}